Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bundler): add --windows-icon, --windows-no-console, fix bun.exe's main icon #15894

Merged
merged 9 commits into from
Dec 20, 2024

Conversation

paperdave
Copy link
Member

@paperdave paperdave commented Dec 20, 2024

Missing tests because writing one is very non-trivial.

--windows-icon is currently gated to windows build hosts (no cross compilation), as the current approach uses a library that calls the Windows API. In the future, we should replace this with a portable version that just manipulates the bytes in-memory.

Fixes #10823
Fixes #13084

@robobun
Copy link

robobun commented Dec 20, 2024

Updated 3:39 AM PT - Dec 20th, 2024

@Jarred-Sumner, your commit 8c4adf9 has 1 failures in #8347:


🧪   try this PR locally:

bunx bun-pr 15894

src/cli.zig Outdated Show resolved Hide resolved
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not successfully link on Windows.

lld-link: error: codegen\windows-app-info.rc: unknown file type

@Jarred-Sumner Jarred-Sumner merged commit 7b3554f into main Dec 20, 2024
60 of 64 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dave/windows-icon branch December 20, 2024 11:22
@Jarred-Sumner
Copy link
Collaborator

Does not fix Bun's own icon. But it's better than status quo.

@716774
Copy link

716774 commented Dec 22, 2024

I love bun ~

@CosmoMyzrailGorynych
Copy link

CosmoMyzrailGorynych commented Dec 25, 2024

@paperdave @Jarred-Sumner see resedit-cli and their resedit and pe-library npm packages for a pure JS solution for patching windows executables. I've been already using them for Neutralino, NW.JS and Bun binaries for a long time to edit and sign windows executables in a Linux CI, both in Node.js and Bun.

resedit-cli has a nice programmatic API despite being primarily a CLI tool. You might want to use resedit directly to exclude unneeded bulk.

Plus you can use the pe-library to write tests to check for icons and metadata.

@CosmoMyzrailGorynych
Copy link

CosmoMyzrailGorynych commented Dec 25, 2024

Here is what I'm doing in my Buntralino — I implemented icon addition and no-console before this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants